package com.huawei.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class ApplicationStartupListener {

    @Autowired
    private ApplicationContext applicationContext;

    @Autowired
    private MyBean myBean;

//    @EventListener(ApplicationReadyEvent.class)
    @PostConstruct
    public void onApplicationReady() {
        // 初始化操作
        System.out.println("Spring Boot 应用已完全启动，执行初始化操作");
    }
}
